package hlhj.fhp.checkpoint.utils

import android.app.Activity
import android.content.Context
import android.view.inputmethod.InputMethodManager.HIDE_NOT_ALWAYS
import android.content.Context.INPUT_METHOD_SERVICE
import android.view.inputmethod.InputMethodManager
import android.content.Context.INPUT_METHOD_SERVICE




/**
 * Created by Never Fear   on 2018\11\29 0029.
Never More....
 */
object KeyboardUtil {
    /**
     * 隐藏键盘
     */
    fun hideInput(activity:Activity) {
        val imm =activity. getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
        val v = activity.getWindow().peekDecorView()
        if (null != v) {
            imm.hideSoftInputFromWindow(v!!.getWindowToken(), 0)
        }
    }

}